.he '=>''Page %'
.fo 'Steven Hardy'- % -'April 1978'
The print arrow, =>
.br
--------------------
.br
This symbol has two
.ul
completely
separate meanings:-

i)   As a print arrow it can be used to print things neatly.  It first prints
a new line and a couple of asterisks, then
prints everything on the stack (thus leaving the stack empty), and finally a new line.
Confusingly
it prints the stack from bottom to top (not top to
bottom as one might expect).
Thus:
 	: 3, 4 * 5, DOUBLE(2) =>
 	** 3 20 4
.br
If this were the full definition, the print arrow could not sensibly be used
inside a function - for we have no way of knowing
what will be on the stack when any particular function is called.
For this
reason, if called inside a function (more precisely, 'not at execute level') the printarrow removes and prints
only one thing - the top element of the stack.
(See the PRINTARROW demo)
.br

ii)   The second use is more complicated.  Frequently functions build up their
results in some variables and put the values of
these variables on the stack as their last action before returning to the
caller.  For example:
.tp 11
 	: FUNCTION COUNT(LIST);
 	:	VARS TOTAL;
 	:	0 -> TOTAL;
 	:	UNTIL	LIST = []
 	:	THEN	HD(LIST) + TOTAL -> TOTAL;
 	:		TL(LIST) -> LIST;
 	:	CLOSE;
 	:	TOTAL;
 	: END;
 	: COUNT([1 7 9 16 3]) =>
 	** 36
.br
We can make the definition of this function neater and simpler using
'output locals', thus:
.tp 8
 	: FUNCTION COUNT(LIST) => TOTAL;
 	:	0 -> TOTAL;
 	:	UNTIL	LIST = []
 	:	THEN	HD(LIST) + TOTAL -> TOTAL;
 	:		TL(LIST) -> LIST;
 	:	CLOSE;
 	: END;
.br
TOTAL is now an 'output local' of the function COUNT.
It is automatiocally
declared as a variable local to COUNT
and its value is stacked when COUNT exits.

Functions can have any number of output locals - they will be stacked in the
order they follow =>.  Naturally, if a function has no output
locals the symbol => can be omitted.  i.e.
 	: FUNCTION FOO(X) => ; ... END;
.br
is equivalent to:
 	: FUNCTION FOO(X); ... END;
